<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

<script type="text/javascript">
    function submitForm() {
        document.getElementById("dbselectform").submit();
    }
</script>

    <div id="left" class="cleft">
        <div class="cmb">
            <a href="<c:url value="/user/welcome.do"/>">Home</a>
            <a href="<c:url value="/common/logout.do"/>">Logout</a>
        </div>

        <form action="<c:url value="/user/tablelist.do"/>" method="post" id="dbselectform" class="cdbselectform">
            <label class="description">Seleziona Database</label>
            <div class="selectdb">
                <%--<html:select property="schema" styleId="schema" styleClass="element select large" onchange="submitForm();">
                    <option value="0">Scegli il db...</option>
                    <html:options name="schemas"></html:options>
                </html:select>--%>
                <select class="styleselect" name="schema" id="schema" onchange="submitForm();">
                    <option value="0">Scegli il db...</option>
                    <logic:iterate name="schemas" id="item">
                        <option value="<bean:write name='item' />" <logic:equal name="item" value="${requestScope.schema}">selected="selected"</logic:equal>><bean:write name='item' /></option>
                    </logic:iterate>
                </select>
            </div>
            <br/><br/>
            <label class="description">Elenco Tabelle</label>
            <div id="dbname" class="cdbname"><bean:write name="schema"/></div>
            <div class="ctablelist" id="tablelist">
                <ul>
                    <logic:iterate  name="tables" id="item">
                        <li><a <logic:equal name="item" property="name" value="${requestScope.tablename}">class="currenttable"</logic:equal> href="<c:url value="/user/showtableinfo.do?tablename="/><bean:write name='item' property='name'/>&amp;schemaname=<bean:write name='schema'/>" title="<bean:write name='item' property="remarks"/>"><bean:write name='item' property="name"/></a></li>
                    </logic:iterate>
                </ul>
            </div>
        </form>
    </div>
